<template>
  <view class="content">
    <view class="components-title">
      <view class="components-title-t">gg-input-digit</view>
      <view class="components-title-d">小数输入框</view>
    </view>
    <gg-nav-group>
      <gg-input-digit label="金额" :tip="tip" v-model="formData.price" :placeholder="placeholder" labelWidth="" />
    </gg-nav-group>
    <gg-nav-group label="带有单位">
      <gg-input-digit label="金额" :tip="tip" :rtip="rtip" v-model="formData.price" must :placeholder="placeholder" labelWidth="" layout="col" />
    </gg-nav-group>
  </view>
</template>

<script>
export default {
  data() {
    return {
      placeholder: '请输入金额',
      tip: '请根据实际情况填写有效金额',
      rtip: 'RMB',
      formData: {
        price: '',
      },
    };
  },
  onLoad() {
    setTimeout(() => {
      this.testReqMocck().then((res) => {
        this.formData.price = "989.01"
      });
      console.log('模拟请求数据', this.formData);
    }, 1000)
  },
  methods: {
    bindTimeChange(e) {

    },
    clickTest(e) {
      console.log(this.formData.price)
    },
    testReqMocck(testData) {
      return new Promise((resolve, reject) => {
        resolve({
        });
      });
    }
  }
}
</script>

<style>
page {
  background: #f1f1f1;
}
</style>
